﻿using System;
using System.Web;
using System.Web.UI;

namespace UI.Classes
{
    /// <summary>
    /// Página con funcionamiento AJAX.
    /// </summary>
    public abstract class AjaxPage: Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string ret = OnRequest();

            Response.ContentType = "application/json";
            Response.Write(ret);
            HttpContext.Current.ApplicationInstance.CompleteRequest();
        }

        protected abstract string OnRequest();
    }
}
